<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/3/3
 * Time: 8:49
 */

namespace app\api\validate;


use think\Validate;

class Userinfo extends Validate
{
    protected $rule = [
        'user_id'=>'require',
        'sex|性别'=>'require|max:1',
        'nickname|昵称'=>'require',
        'name|名称'=>'require',
        'idcard|身份证号码'=>'idCard',
        'idcards_back|身份证反面'=>'require',
        'idcards_front|身份证正面'=>'require',
        'license|营业执照'=>'require',
        'face|头像'=>'require'
    ];

    /**
     * 设置个人资料
     */
    public function sceneSetuserinfo()
    {
        return $this->only(['user_id','nickname','face']);
    }

    /**
     * 实名认证
     */
    public function sceneAuthentication()
    {
        return $this->only(['user_id','name','idcard','idcards_back','idcards_front','license']);
    }
}